package collection;

import java.util.ArrayList;
import java.util.List;

public class ListDemo2 {
    public static void main(String[] args) {
        List<String> list=new ArrayList<>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("d");
        list.add("e");
        System.out.println("list:"+list);

        list.add(3,"z");
        System.out.println("list:"+list);
        list.add(6,"q");
        System.out.println("list:"+list);

        list.remove(3);
        System.out.println("list:"+list);
        list.remove("a");
        System.out.println("list:"+list);


    }
}
